@import (reference) "../../../color.less";

.trade-bid-ask(
  @content-background-color,
  @main-font-color,
  @second-font-color,
  @hover-background-color,
  @split-line-color
) {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 12px;
  background: @content-background-color;
  transition: all .2s;
  .trade-bid-ask-list-row-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 24px;
    margin: 0 8px;
    color: @second-font-color;
  }

  .trade-bid-ask-list-row-item {
    display: inline-block;
    &[datatype="price"] {
      width: 30%;
      padding-left: 4px;
    }
    &[datatype="volume"] {
      width: 30%;
      text-align: right;
    }
    &[datatype="totalVolume"] {
      width: 40%;
      padding-right: 4px;
      text-align: right;
    }
    &[direction="buy"] {
      color: @main-green-color;
    }
    &[direction="sell"] {
      color: @main-red-color;
    }
  }
  .trade-bid-ask-list-container {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    .trade-bid-ask-list-content {
      display: flex;
      flex: 1;
      flex-direction: column;
      ul {
        li {
          position: relative;
          height: 20px!important;
          color: @main-font-color!important;
          cursor: pointer;
          font-family: Arial, serif;
          &:hover {
            background: @hover-background-color;
          }
          .trade-bid-ask-list-row-rate {
            display: inline-block;
            position: absolute;
            height: 16px;
            top: 2px;
            bottom: 2px;
            right: 0;
            opacity: .08;
            transition: all .2s;
            &[datatype="buy"] {
              background: @main-green-color;
            }
            &[datatype="sell"] {
              background: @main-red-color;
            }
          }
        }
      }
    }
    .trade-bid-ask-list-last-price {
      height: 28px;
      display: flex;
      flex-direction: row;
      align-items: center;
      padding: 0 12px;
      color: @main-font-color;
      font-size: 18px;
      border-top: solid 1px @split-line-color;
      border-bottom: solid 1px @split-line-color;
      transition: all .2s;
      &[datatype='up'] {
        color: @main-green-color;
      }
      &[datatype='low'] {
        color: @main-red-color;
      }
      .trade-bid-ask-list-last-price-tag {
        font-size: 12px;
        font-weight: bold;
      }
    }
    .trade-bid-ask-list-last-price-float {
      justify-content: space-between;
      position: absolute;
      width: 100%;
      background: @content-background-color;
      z-index: 1;
      &[position="top"] {
        top: 0;
      }
      &[position="bottom"] {
        bottom: 0;
        border-bottom-color: transparent;
      }
      .trade-bid-ask-list-last-price-reset-button {
        color: @main-blue-color;
        font-size: 12px;
        background: transparent;
      }
    }
  }
}

.trade-bid-ask-night {
  .trade-bid-ask(
    @content-background-color-night,
    @main-font-color-night,
    @second-font-color-night,
    @hover-background-color-night,
    @split-line-color-night
  )
}

.trade-bid-ask-day {
  .trade-bid-ask(
    @content-background-color-day,
    @main-font-color-day,
    @second-font-color-day,
    @hover-background-color-day,
    @split-line-color-day
  )
}
